<template>
	<view class="content">
		<scroll-view scroll-y class="left-aside">
			<view 
			@click="navToList(item)"
			 v-for="item in flist" :key="item.id"
			  class="f-item b-b" 
			  :class="{active: item.id === currentId}">
			{{item.name}}
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		props: {
			 // 第一级数组
			flist: {
				type: Array,
				default: []
			},
		
		
		},
		data() {
			return {
				sizeCalcState: false,
				tabScrollTop: 0,
				currentId: 4,  // 匹配列表第一个id  要和第一次显示的 id 一样
				
				
			}
		},

		methods: {
			navToList(item) {
					this.currentId = item.id;			
				this.$emit("click",item);
				
			}
		}
	}
</script>

<style lang='scss'>
	page,
	.content {
		height: 100%;
		background-color: #fff;
	}

	.content {
		display: flex;
	}

	.left-aside {
		flex-shrink: 0;
		width: 162rpx;
height: 100%;
		background-color: #F5F8F9;
	}

	.f-item {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100upx;
		font-size: 28upx;
		color: black;
		position: relative;

		&.active {
			color: black;
			background: #fff;

			&:before {
				content: '';
				position: absolute;
				left: 0;
				top: 50%;
				transform: translateY(-50%);
				height: 40rpx;
				width: 8upx;
		background: linear-gradient(90deg, #C0D7DB 0%, #73A7B0 100%);
				border-radius: 0 3px 3px 0;
				opacity: .8;
			}
		}
	}

	.right-aside {
		flex: 1;
		overflow: hidden;
		padding-left: 20upx;
	}

	.s-item {
		display: flex;
		align-items: center;
		height: 70upx;
		padding-top: 8upx;
		font-size: 28upx;
		color: orange;
	}

	.t-list {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
		background: #fff;
		padding-top: 12upx;

		&:after {
			content: '';
			flex: 99;
			height: 0;
		}
	}

	.t-item {
		flex-shrink: 0;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		width: 176upx;
		font-size: 26upx;
		color: #666;
		padding-bottom: 20upx;

		image {
			width: 140upx;
			height: 140upx;
		}
	}
</style>